FLUSH VIDEO MEMORY

This command will flush all textures and other resources from active video memory.

  Syntax
FLUSH VIDEO MEMORY
  Returns

This command does not return a value.

  Description

You should use this command when you are dramatically changing the contents of your 3D scene such as changing game levels or entering a new environment. This technique will improve performance during the initial renders of a new scene.

  Example Code
sync on
sync rate 120
hide mouse
cls 0
ObjectNumber=1
make object sphere ObjectNumber,10
color object ObjectNumber,rgb(0,0,255)
while mouseclick()=0
set cursor 0,0
if scancode()>1 and scancode()<8
if object exist(ObjectNumber)=1 then delete object ObjectNumber
flush video memory
endif
if inkey$()="1" then make object cube ObjectNumber,10:color object ObjectNumber,rgb(0,0,255)
if inkey$()="2" then make object box ObjectNumber,10,10,20:color object ObjectNumber,rgb(0,0,255)
if inkey$()="3" then make object cylinder ObjectNumber,10:color object ObjectNumber,rgb(0,0,255)
if inkey$()="4" then make object cone ObjectNumber,10:color object ObjectNumber,rgb(0,0,255)
if inkey$()="5" then make object plain ObjectNumber,10,10:color object ObjectNumber,rgb(0,0,255)
if inkey$()="6" then make object triangle ObjectNumber, 0, 0, 0, 5, 5, 0, 0, 5, 0:color object ObjectNumber,rgb(0,0,255)
xrotate object ObjectNumber,wrapvalue(object angle x(ObjectNumber)+1)
yrotate object ObjectNumber,wrapvalue(object angle y(ObjectNumber)+1)
sync
endwhile
delete object ObjectNumber
end
  See also

BASIC3D Commands Menu
Index